// 导入模块 http
const http =require('http');
// 创建服务器
const server = http.createServer();
// 调用 on request
server.on("request",(req)=>{
// req.url是请求的路径 /xxx
// req.method是方法     get/post..
const str =`Your request url is ${req.url},and request method is ${req.method}`
console.log(str);
})
// 启动服务
server.listen(80,()=>{
    console.log("serve running at http://127.0.0.1");
})